package com.sky.propertyChangeSupport;


import sky.JULLog.MyLogger;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.logging.Logger;

public class Client {

    private  static  Logger log = MyLogger.getLogger(Client.class);

    private static  final TomcatBeta TOMCAT_BETA = new TomcatBeta();


    /**
     * 配置监听器
     * */
    private void config(){
        TOMCAT_BETA.addPropertyChangeListener("serverPort", new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent changeEvent) {
                log.info( changeEvent.getPropertyName() +"  " + changeEvent.getOldValue() + " update to " +changeEvent.getNewValue());
            }
        });
    }

    public static void main(String[] args) {
        new Client().config();
        TOMCAT_BETA.setServerPort(1234);
        TOMCAT_BETA.setServerPort(4321);




    }

}
